<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2021/7/23
  Time: 11:03
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目管理系统</title>
    <link href="static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="static/css/animate.min.css" rel="stylesheet">
    <link href="static/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
</head>
<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div>
            <h1 class="logo-name">ssm</h1>
        </div>
        <h3>欢迎使用 项目管理系统</h3>
        <div class="m-t" role="form" >
            <div class="form-group">
                <input type="text" class="form-control uaccount" placeholder="用户名" name="uaccount">
            </div>
            <div class="form-group">
                <input type="password" class="form-control upsw" placeholder="密码" name="upsw">
                <span class="msg"></span>
            </div>
            <button type="button" class="btn btn-primary block full-width  login">登 录</button>
            <p class="text-muted text-center"> <a ><small>忘记密码了？</small></a> | <a href="register.jsp">注册一个新账号</a>
            </p>
        </div>
    </div>
</div>
<script src="static/js/jquery.min.js?v=2.1.4"></script>
<script src="static/js/bootstrap.min.js?v=3.3.5"></script>
<script>
    $(function (){
        $(".login").click(function (){
            let uaccount=$(".uaccount").val()
            let upsw=$(".upsw").val()
            $.ajax({
                url:"login",
                method:"post",
                data:{uaccount:uaccount,upsw:upsw},
                success:function (data){
                    if (data!="error"){
                        window.open("index1.jsp");
                    }else {
                        $(".msg").html("账号或密码错误")
                        $(".msg").css("color","red")
                    }
                },
                error:function (){
                    alert("网络异常")
                }
            })
        })
    })
</script>
</body>
</html>
